import 'package:flutter/material.dart';
import 'package:x3_base_core/x3_base_core.dart';

class BusinessCustomerDetailsWxIcon extends StatelessWidget {

  BusinessCustomerDetailsWxIcon({Key key, @required this.item}) : super(key: key);

  final dynamic item;

  @override
  Widget build(BuildContext context) {
    String enterpriseWx = BaseUtils.getKeyData(this.item, 'enterpriseWx').toString();
    String wxNoPublic = BaseUtils.getKeyData(this.item, 'wxNoPublic').toString();
    return Row(
      crossAxisAlignment: CrossAxisAlignment.center,
      children: [
        _buildWxIconItem( wxNoPublic, BaseIconData.x3PublicAccount ),
        _buildWxIconItem( enterpriseWx, BaseIconData.x3EnterpriseWX ),
      ],
    );
  }

  Widget _buildWxIconItem(String wx, IconData iconData) {
    return wx == 'true' ? Padding(padding: const EdgeInsets.only(left: 4.0), child: Icon(iconData, size: 16, color: Color(0xFF34A853) )) : SizedBox();
  }

}
